//package org.alfalfa.web;
//
//import io.swagger.annotations.ApiImplicitParam;
//import io.swagger.annotations.ApiImplicitParams;
//import io.swagger.annotations.ApiOperation;
//import org.alfalfa.model.BizEntity;
//import org.springframework.web.bind.annotation.ModelAttribute;
//import org.springframework.web.bind.annotation.PathVariable;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RequestMethod;
//import org.springframework.web.bind.annotation.RestController;
//
//import java.util.ArrayList;
//import java.util.List;
//import java.util.Map;
//import java.util.concurrent.ConcurrentHashMap;
//
///**
// * @Author : Max-Goday
// * @Created : 2016-09-29
// * @E-mail : goday.max@gmail.com
// * @Version : 1.0
// */
//@RestController
//@RequestMapping("/biz")
//public class BizController {
//
//	//concurrnt entiy map
//	static Map<Integer, BizEntity> MAP = new ConcurrentHashMap<>();
//
//	@ApiOperation(value = "获取BizEntity列表", notes = "")
//	@RequestMapping(value = "/", method = RequestMethod.GET)
//	public List<BizEntity> listEntity() {
//		List<BizEntity> es = new ArrayList<BizEntity>(MAP.values());
//		return es;
//	}
//
//	@ApiOperation(value = "创建BizEntity")
//	@ApiImplicitParam(name = "BizEntity", value = "业务实体对象", required = true, dataType = "BizEntity")
//	@RequestMapping(value = "/", method = RequestMethod.POST)
//	public String postEntity(@ModelAttribute BizEntity bizEntity) {
//		MAP.put(bizEntity.getId(), bizEntity);
//		return "done";
//	}
//
//	@ApiOperation(value = "根据ID获取业务实体")
//	@ApiImplicitParam(name = "id", value = "业务实体ID", required = true, dataType = "Integer")
//	@RequestMapping(value = "/{id}", method = RequestMethod.GET)
//	public BizEntity getById(@PathVariable Integer id) {
//		return MAP.get(id);
//	}
//
//
//	@ApiOperation(value = "更新业务实体", notes = "根据url指定id来更新业务实体")
//	@ApiImplicitParams({
//			@ApiImplicitParam(name = "id", value = "业务实体ID", required = true, dataType = "Integer"),
//			@ApiImplicitParam(name = "BizEntity", value = "业务实体对象", required = true, dataType = "BizEntity")
//	})
//	@RequestMapping(value = "/{id}", method = RequestMethod.PUT)
//	public String putById(@PathVariable Integer id, @ModelAttribute BizEntity bizEntity) {
//		BizEntity e = MAP.get(id);
//		e.setDescription(bizEntity.getDescription());
//		e.setName(bizEntity.getName());
//		return "done";
//	}
//
//
//	@ApiOperation(value = "删除业务实体", notes = "根据url指定id删除业务实体")
//	@ApiImplicitParam(name = "id", value = "业务实体ID", required = true, dataType = "Integer")
//	@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
//	public String DeleteById(@PathVariable Integer id) {
//		MAP.remove(id);
//		return "done";
//	}
//
//
//}
